import { MigrationInterface, QueryRunner } from 'typeorm';

export class Gen11684487301252 implements MigrationInterface {
  name = 'Gen11684487301252';

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; 
      CREATE TABLE "users" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "lastNameRu" text, "lastNameEn" text, "firstNameRu" text, "firstNameEn" text, "positionId" uuid, "positionNameRu" text, "positionNameEn" text, "unitId" uuid, "unitNameRu" text, "unitNameEn" text, "head1Id" text, "head1NameRu" text, "head1NameEn" text, "head1Email" text, "email" text, "phone" text, "workplace" text, "birthDate" text, "orgUuid" uuid, "orgNameRu" text, "orgNameEn" text, "cityRu" text, "cityEn" text, "hideEmployee" boolean NOT NULL DEFAULT false, "favorites" json NOT NULL DEFAULT '[]', CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id"))`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`DROP TABLE "users"`);
  }
}
